#include "Hashtable.h"
#include "unordered_map.h"
#include "unordered_set.h"
using namespace Su;



int main()
{
	Su::unordered_map<string, string> dict;
	Su::unordered_set<string> dic;

	dict.insert(make_pair("left", "左边"));
	dict.insert(make_pair("right", "右边"));
	dict.insert(make_pair("insert", "插入"));
	dict.print();
	dict["test"] = "测试";
	dict.print();

	Su::unordered_map<string, string>::iterator it = dict.begin();
	Su::unordered_map<string, string>::const_iterator cit = dict.begin();
	cout << "用迭代器获得dict的第一个元素：" << (*it).first << "->" << (*it).second << endl << endl;
	++it;
	cout << "用迭代器获得dict的第二个元素：" << (*it).first << "->" << (*it).second << endl << endl;
	++it;
	cout << "用迭代器获得dict的第三个元素：" << (*it).first << "->" << (*it).second << endl << endl;
	++it;
	cout << "用迭代器获得dict的第四个元素：" << (*it).first << "->" << (*it).second << endl << endl;
	//cit->first = "111";报错，没有修改权限
	

	dic.insert("left");
	dic.insert("right");
	dic.insert("insert");
	dic.print();

	Su::unordered_set<string>::iterator sit = dic.begin();
	cout << "用迭代器获得dic的第一个元素：" << (*sit) <<  endl << endl;
	++sit;
	cout << "用迭代器获得dic的第二个元素：" << (*sit)<<  endl << endl;
	++sit;
	cout << "用迭代器获得dic的第三个元素：" << (*sit) <<  endl << endl;

	return 0;
}